<!-- 
    1.document.write()
    2.element.innerHTML
    3.document.createElement()
 -->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button>点击</button>
    <p>abc</p>
    <div class="inner"></div>
    <div class="create"></div>

    <script>
        //1.三种创建元素的区别document.write()鸡肋
        // document.write('<div>123</div>')

        //2.element.innerHTML=标签
        var inner = document.querySelector('.inner');
        // inner.innerHTML = '<a href="#">百度</a>';
        var arr = [];
        for (var i = 0; i <= 100; i++) {
            arr.push('<a href="#">百度</a>');
        }
        inner.innerHTML = arr.join('');




        //3.document.createElement()   父节点.appendChild(子节点)
        //创建多个元素效率高
        var create = document.querySelector('.create');
        var a = document.createElement('a');
        create.appendChild(a);

    </script>
</body>

</html>